package com.zhangsun.controller;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.zhangsun.producer.HelloProducer;
import com.zhangsun.system.entity.UserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private HelloProducer helloProducer;

    @RequestMapping("/hello")
    public String hello(String msg) {
        UserEntity user = new UserEntity();
        user.setId(IdWorker.getIdStr());
        user.setName("admin");
        user.setUserNo("admin");
        helloProducer.send(user);
        return "success";
    }

}
